package javapop.framework.parser.expr.generic;

import javapop.framework.generic.GExprOperator;
import javapop.framework.generic.GExprOperator.Type;
import javapop.framework.parser.expr.ExprNode;
import javapop.framework.parser.expr.PostfixNode;

public class CPostFixNode<T> extends CExprNode<T> implements PostfixNode {

	private GExprOperator op;
	private ExprNode operand;
	private int prio;
	
	public CPostFixNode(GExprOperator op, T data) {
		super(data);
		this.op = op;
		this.prio = op.getPrio();
		assert(op.getType() == Type.POSTFIX);
	}

	@Override
	public ExprNode getOperand() {
		return operand;
	}

	@Override
	public void setOperand(ExprNode operand) {
		this.operand = operand;

	}

	@Override
	public int getPrio() {
		return prio;
	}

	@Override
	public void setPrio(int prio) {
		this.prio = prio;
	}

	@Override
	public boolean isPostfix() {
		return true;
	}
}
